Optimal. Leaf size=56 \[ \frac{a (A+B) \tan (c+d x)}{d}+\frac{a (A+2 B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac{a A \tan (c+d x) \sec (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.136926, antiderivative size = 56, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.207, Rules used = {2968, 3021, 2748, 3767, 8, 3770} \[ \frac{a (A+B) \tan (c+d x)}{d}+\frac{a (A+2 B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac{a A \tan (c+d x) \sec (c+d x)}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2968
Rule 3021
Rule 2748
Rule 3767
Rule 8
Rule 3770
Rubi steps
\begin{align*} \int (a+a \cos (c+d x)) (A+B \cos (c+d x)) \sec ^3(c+d x) \, dx &=\int \left (a A+(a A+a B) \cos (c+d x)+a B \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx\\ &=\frac{a A \sec (c+d x) \tan (c+d x)}{2 d}+\frac{1}{2} \int (2 a (A+B)+a (A+2 B) \cos (c+d x)) \sec ^2(c+d x) \, dx\\ &=\frac{a A \sec (c+d x) \tan (c+d x)}{2 d}+(a (A+B)) \int \sec ^2(c+d x) \, dx+\frac{1}{2} (a (A+2 B)) \int \sec (c+d x) \, dx\\ &=\frac{a (A+2 B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac{a A \sec (c+d x) \tan (c+d x)}{2 d}-\frac{(a (A+B)) \operatorname{Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d}\\ &=\frac{a (A+2 B) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac{a (A+B) \tan (c+d x)}{d}+\frac{a A \sec (c+d x) \tan (c+d x)}{2 d}\\ \end{align*}
Mathematica [A] time = 0.0267637, size = 75, normalized size = 1.34 \[ \frac{a A \tan (c+d x)}{d}+\frac{a A \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac{a A \tan (c+d x) \sec (c+d x)}{2 d}+\frac{a B \tan (c+d x)}{d}+\frac{a B \tanh ^{-1}(\sin (c+d x))}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.093, size = 86, normalized size = 1.5 \begin{align*}{\frac{aA\tan \left ( dx+c \right ) }{d}}+{\frac{aB\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}}+{\frac{aA\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{2\,d}}+{\frac{aA\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{2\,d}}+{\frac{aB\tan \left ( dx+c \right ) }{d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.990203, size = 128, normalized size = 2.29 \begin{align*} -\frac{A a{\left (\frac{2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 2 \, B a{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 4 \, A a \tan \left (d x + c\right ) - 4 \, B a \tan \left (d x + c\right )}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.40884, size = 239, normalized size = 4.27 \begin{align*} \frac{{\left (A + 2 \, B\right )} a \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) -{\left (A + 2 \, B\right )} a \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \,{\left (2 \,{\left (A + B\right )} a \cos \left (d x + c\right ) + A a\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.24106, size = 167, normalized size = 2.98 \begin{align*} \frac{{\left (A a + 2 \, B a\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) -{\left (A a + 2 \, B a\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) - \frac{2 \,{\left (A a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 2 \, B a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 3 \, A a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 2 \, B a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]